package com.eoner.baselibrary.widget;

import android.content.Context;
import android.widget.ImageView;
import com.eoner.baselibrary.R;
import com.eoner.baselibrary.utils.GlideUtil;
import com.eoner.baselibrary.utils.ScreenUtils;
import com.eoner.baselibrary.utils.ViewTransformUtil;
import com.youth.banner.loader.ImageLoader;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation;

/**
 * 作者：sean
 * 创建时间：2017/6/14 00:20
 * 功能说明：
 */

public class PicassoImageLoader extends ImageLoader {

    private int mWidth,mHeight,radiu;
    public PicassoImageLoader(int width,int height) {
        this.mWidth = width;
        this.mHeight = height;
        radiu = ScreenUtils.dp2px(7);
    }
    public PicassoImageLoader(int width,int height,int radiu) {
        this.mWidth = width;
        this.mHeight = height;
        this.radiu = radiu;
    }


    @Override
    public void displayImage(Context context, Object path, ImageView imageView) {

        ViewTransformUtil.glideImageView(context,(String) path,imageView,
                new RoundedCornersTransformation(radiu, 0), R.mipmap.defaults_1);
    }
}
